<?php

//    class SendEmail{
//        
//        function send($to, $subject, $message){
//            
//            if(mail($to, $subject, $message)){
//                echo"sent";
//            }else{
//                echo"not sent";
//            }
//        }
//    }
    
    //$send= new SendEmail();
    //$send.send("mamdooh26@hotmail.com","Test", "This is a test");
    //$send -> send("mamdooh26@hotmail.com","Test", "This is a test");
    set_time_limit(600);
require_once '../../SwiftMailer/lib/swift_required.php';
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com')
  ->setPort(465)
 // ->setEncryption('ssl')
  ->setUsername('mamdooh26@gmail.com')
  ->setPassword('mamdooh8705')
  ;

    
    $mailer = Swift_Mailer::newInstance($transport);
    $message = Swift_Message::newInstance()
    ->setSubject('Your subject')
    ->setFrom(array('mamdooh26@gmail.com' => 'Mamdouh Alharbi'))
    ->setTo(array('mamdooh26@hotmail.com' => 'To me'))
    ->setBody('Here is the message itself');
    //->addPart('<q>Here is the message itself</q>', 'text/html')
   // ->attach(Swift_Attachment::fromPath('C:\Users\Mamdooh\Documents\f-rtl.zip'))
   $mailer->send($message);
    
?>
